<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: MacToNetwControlInfo Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00132.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">MacToNetwControlInfo Class Reference<div class="ingroups"><a class="el" href="a00518.html">baseUtils - utilities for base MiXiM</a> &#124; <a class="el" href="a00509.html">macLayer - MAC layer modules</a> &#124; <a class="el" href="a00507.html">netwLayer - network layer modules</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="MacToNetwControlInfo" -->
<p>Stores control information from mac to upper layer.  
 <a href="a00132.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00308_source.html">MacToNetwControlInfo.h</a>&gt;</code></p>

<p><a href="a00842.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a64db17e5d3c98005d3116db08853960d"></a><!-- doxytag: member="MacToNetwControlInfo::MacToNetwControlInfo" ref="a64db17e5d3c98005d3116db08853960d" args="(const LAddress::L2Type &amp;lastHop, double ber=0, double rssi=0)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a64db17e5d3c98005d3116db08853960d">MacToNetwControlInfo</a> (const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;lastHop, double ber=0, double <a class="el" href="a00132.html#a5cfb3c928d4706098e74ac8e1dc95b7e">rssi</a>=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes with the passed last hop address and bit error rate. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="affe2b8ca5fb613155ffa6818dd5338ae"></a><!-- doxytag: member="MacToNetwControlInfo::getBitErrorRate" ref="affe2b8ca5fb613155ffa6818dd5338ae" args="() const " -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#affe2b8ca5fb613155ffa6818dd5338ae">getBitErrorRate</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the bit error rate for this packet. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#ac893214f0521cb356739841c63f1c498">setBitErrorRate</a> (double ber)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the bit error rate for this control infos packet.  <a href="#ac893214f0521cb356739841c63f1c498"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a308453ed9a395b5150618bca3294d0b9"></a><!-- doxytag: member="MacToNetwControlInfo::getLastHopMac" ref="a308453ed9a395b5150618bca3294d0b9" args="() const " -->
const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a308453ed9a395b5150618bca3294d0b9">getLastHopMac</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the MAC address of the packets last hop. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a789cde71306e4d00c552c502a09e9a12">setLastHopMac</a> (const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;lastHop)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the MAC address of the packets last hop.  <a href="#a789cde71306e4d00c552c502a09e9a12"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#ac7eaf00a314034039ed8dc283518332b">getRSSI</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the packets received signal strength.  <a href="#ac7eaf00a314034039ed8dc283518332b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#ac912ee19746ecde01512876568c95839">setRSSI</a> (double _rssi)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the packets received signal strength.  <a href="#ac912ee19746ecde01512876568c95839"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static cObject *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a08ffc5756ab41f2c5ba4e7fa1f64b924">setControlInfo</a> (cMessage *const pMsg, const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;pSrcAddr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attaches a "control info" structure (object) to the message pMsg.  <a href="#a08ffc5756ab41f2c5ba4e7fa1f64b924"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a94a1bdc4327f5fdefd1b6b8112d21dc4"></a><!-- doxytag: member="MacToNetwControlInfo::getAddress" ref="a94a1bdc4327f5fdefd1b6b8112d21dc4" args="(cMessage *const pMsg)" -->
static const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>getAddress</b> (cMessage *const pMsg)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3749066e121d0e912e6aeb92dd8a480c"></a><!-- doxytag: member="MacToNetwControlInfo::getAddressFromControlInfo" ref="a3749066e121d0e912e6aeb92dd8a480c" args="(cObject *const pCtrlInfo)" -->
static const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>getAddressFromControlInfo</b> (cObject *const pCtrlInfo)</td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0be178839f0e97e8695e5915e84b6dd2"></a><!-- doxytag: member="MacToNetwControlInfo::bitErrorRate" ref="a0be178839f0e97e8695e5915e84b6dd2" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a0be178839f0e97e8695e5915e84b6dd2">bitErrorRate</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The bit error rate for this packet. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a69d09f2d4b0f7603b5cfa0bd8efafe61"></a><!-- doxytag: member="MacToNetwControlInfo::lastHopMac" ref="a69d09f2d4b0f7603b5cfa0bd8efafe61" args="" -->
<a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a69d09f2d4b0f7603b5cfa0bd8efafe61">lastHopMac</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">MAC address of the last hop of this packet. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5cfb3c928d4706098e74ac8e1dc95b7e"></a><!-- doxytag: member="MacToNetwControlInfo::rssi" ref="a5cfb3c928d4706098e74ac8e1dc95b7e" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a5cfb3c928d4706098e74ac8e1dc95b7e">rssi</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The received signal strength for this packet. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Stores control information from mac to upper layer. </p>
<p>Holds the bit error rate of the transmission as well as the MAC address of the last hop.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Karl Wessel </dd></dl>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac7eaf00a314034039ed8dc283518332b"></a><!-- doxytag: member="MacToNetwControlInfo::getRSSI" ref="ac7eaf00a314034039ed8dc283518332b" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual double MacToNetwControlInfo::getRSSI </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the packets received signal strength. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The received signal strength </dd></dl>
<div class="fragment"><pre class="fragment">                                 {
    <span class="keywordflow">return</span> <a class="code" href="a00132.html#a5cfb3c928d4706098e74ac8e1dc95b7e" title="The received signal strength for this packet.">rssi</a>;
  }
</pre></div>
</div>
</div>
<a class="anchor" id="ac893214f0521cb356739841c63f1c498"></a><!-- doxytag: member="MacToNetwControlInfo::setBitErrorRate" ref="ac893214f0521cb356739841c63f1c498" args="(double ber)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void MacToNetwControlInfo::setBitErrorRate </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>ber</em></td><td>)</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the bit error rate for this control infos packet. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">ber</td><td>The bit error rate </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="a00068.html#ab2174202ba00f0731fc9924597aba925">CSMA802154::decapsMsg()</a>.</p>
<div class="fragment"><pre class="fragment">                                           {
    <a class="code" href="a00132.html#a0be178839f0e97e8695e5915e84b6dd2" title="The bit error rate for this packet.">bitErrorRate</a> = ber;
  }
</pre></div>
</div>
</div>
<a class="anchor" id="a08ffc5756ab41f2c5ba4e7fa1f64b924"></a><!-- doxytag: member="MacToNetwControlInfo::setControlInfo" ref="a08ffc5756ab41f2c5ba4e7fa1f64b924" args="(cMessage *const pMsg, const LAddress::L2Type &amp;pSrcAddr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static cObject* MacToNetwControlInfo::setControlInfo </td>
          <td>(</td>
          <td class="paramtype">cMessage *const&#160;</td>
          <td class="paramname"><em>pMsg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td>
          <td class="paramname"><em>pSrcAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Attaches a "control info" structure (object) to the message pMsg. </p>
<p>This is most useful when passing packets between protocol layers of a protocol stack, the control info will contain the source MAC address.</p>
<p>The "control info" object will be deleted when the message is deleted. Only one "control info" structure can be attached (the second setL3ToL2ControlInfo() call throws an error).</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pMsg</td><td>The message where the "control info" shall be attached. </td></tr>
    <tr><td class="paramname">pSrcAddr</td><td>The MAC address of the message sender. </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="a00026.html#a3f1d2f1614a5d25f8b5f64b74e1c40a7">BaseMacLayer::setUpControlInfo()</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                         {
      <a class="code" href="a00132.html" title="Stores control information from mac to upper layer.">MacToNetwControlInfo</a> *<span class="keyword">const</span> cCtrlInfo = <span class="keyword">new</span> <a class="code" href="a00132.html#a64db17e5d3c98005d3116db08853960d" title="Initializes with the passed last hop address and bit error rate.">MacToNetwControlInfo</a>(pSrcAddr);
      pMsg-&gt;setControlInfo(cCtrlInfo);

      <span class="keywordflow">return</span> cCtrlInfo;
    }
</pre></div>
</div>
</div>
<a class="anchor" id="a789cde71306e4d00c552c502a09e9a12"></a><!-- doxytag: member="MacToNetwControlInfo::setLastHopMac" ref="a789cde71306e4d00c552c502a09e9a12" args="(const LAddress::L2Type &amp;lastHop)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void MacToNetwControlInfo::setLastHopMac </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td>
          <td class="paramname"><em>lastHop</em></td><td>)</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the MAC address of the packets last hop. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">lastHop</td><td>The last hops MAC address </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><pre class="fragment">                                                            {
    <a class="code" href="a00132.html#a69d09f2d4b0f7603b5cfa0bd8efafe61" title="MAC address of the last hop of this packet.">lastHopMac</a> = lastHop;
  }
</pre></div>
</div>
</div>
<a class="anchor" id="ac912ee19746ecde01512876568c95839"></a><!-- doxytag: member="MacToNetwControlInfo::setRSSI" ref="ac912ee19746ecde01512876568c95839" args="(double _rssi)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MacToNetwControlInfo::setRSSI </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>_rssi</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the packets received signal strength. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">_rssi</td><td>The received signal strength </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="a00068.html#ab2174202ba00f0731fc9924597aba925">CSMA802154::decapsMsg()</a>.</p>
<div class="fragment"><pre class="fragment">                             {
    <a class="code" href="a00132.html#a5cfb3c928d4706098e74ac8e1dc95b7e" title="The received signal strength for this packet.">rssi</a> = _rssi;
  }
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/utils/<a class="el" href="a00308_source.html">MacToNetwControlInfo.h</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00132.html">MacToNetwControlInfo</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:32 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
